(function() {
  'use strict';

  define(['app'], function(AMail) {
    AMail.factory('StoreManager', function() {
      return {
        getItem: function(key) {
          return JSON.parse(localStorage.getItem(key));
        },

        setItem: function(key, item) {
          var itemText = JSON.stringify(item, null, 2);
          localStorage.setItem(key, itemText);
        }
      };
    });
  });
}).call(this);